<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <div id="app">
        <button @click="show()">点我</button>
        <button v-on:click="show">点我</button>
        <button v-on:click="add()">想数组中添加一个元素</button>
        <br>
        {{arr}}
        <button v-on:mouseover="show">鼠标经过时执行</button>
        <button v-on:dblclick="show">鼠标双击时</button>
    </div>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                arr: [12, 13, 14, 15, 46, 4785]
            },
            methods: {
                show() {
                    console.log("这是show方法")
                },
                add: function () {
                    console.log(this);
                    console.log(vm === this);
                    this.arr.push(898);
                    vm.arr.push(999);
                    console.log(this.arr);
                    this.show();
                }
            }
        })
    </script>
</body>

</html>